package com.xgkj.diyiketang.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RelativeLayout;

import com.xgkj.diyiketang.EatShowApp;
import com.xgkj.diyiketang.R;
import com.xgkj.diyiketang.util.ToastUtil;


/**
 * Created by Tao on 2017/4/26.
 */

public class BeautifulTeacherActivity extends Activity implements View.OnClickListener{

    private Button beautiful_btn;//点击跳转按钮
    private RelativeLayout teacher_back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.beautiful_teacher_activity);
        teacher_back = (RelativeLayout) findViewById(R.id.teacher_back);
        beautiful_btn = (Button) findViewById(R.id.beautiful_btn);
        teacher_back.setOnClickListener(this);
        beautiful_btn.setOnClickListener(this);
    }

    protected EatShowApp getEatShowApp() {
        return (EatShowApp) getApplication();
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.beautiful_btn:
                if (getEatShowApp().getmUserInfo() == null){
                    startActivity(new Intent(BeautifulTeacherActivity.this,LoginActivity.class));
                }else {
                    ToastUtil.showMessage(BeautifulTeacherActivity.this, "参与最美老师直播");
                    Intent zintent = new Intent(BeautifulTeacherActivity.this, YuZhiBoActivity.class);
                    zintent.putExtra("FROM", "ZHIBO");
                    zintent.putExtra("FANSNUM", 0);
                    startActivity(zintent);
                    finish();
                }

                break;
            case R.id.teacher_back:
                finish();
                break;
        }

    }
}
